using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace comm.objst
{
    //#region TableCommander
    [Serializable]
    public class TableCommander : TablePlayerFaction, ICodeReplace
    {
#region 2013-1-4 19:16:52
public const string KEY_COMMANDER_ID="CommanderId";
public const string TITLE="Title";
public const string PRIVILEGE_TYPE_LIST="PrivilegeTypeList";
public const string PLAYER_ID="PlayerId";
public const string FAC_ID="FacId";

#endregion
public comm.CodeFill FillRegion()
        {
            return new CodeFill(CodeFillType.ORM_CONST, this);
        }

        private string _commanderId = null;
        [OrmAttr(true)]
        public string CommanderId
        {
            get
            {
                if (_commanderId == null)
                {
                    _commanderId = comm.GUID.NewString();
                }
                return _commanderId;
            }
            set { _commanderId = value; }
        }

        private string _title = null;
        public string Title
        {
            get
            {
                if (_title == null)
                {
                    _title = "";
                }
                return _title;
            }
            set { _title = value; }
        }

        private List<CommanderPrivilegeType> _privilegeTypeList = null;
        public List<CommanderPrivilegeType> PrivilegeTypeList
        {
            get
            {
                if (_privilegeTypeList == null)
                {
                    _privilegeTypeList = new List<CommanderPrivilegeType>();
                }
                return _privilegeTypeList;
            }
            set { _privilegeTypeList = value; }
        }
    }
    //#endregion

    [Serializable]
    public class TableServeHistory : TablePlayerFaction
    {
        private string _hsyId = null;
        [OrmAttr(true)]
        public string HsyId
        {
            get
            {
                if (_hsyId == null)
                {
                    _hsyId = comm.GUID.NewString();
                }
                return _hsyId;
            }
            set { _hsyId = value; }
        }

        private DateTime _beginTime = DateTime.Now;
        public DateTime BeginTime
        {
            get { return _beginTime; }
            set { _beginTime = value; }
        }

        private DateTime _endTime = DateTime.Now;
        public DateTime EndTime
        {
            get { return _endTime; }
            set { _endTime = value; }
        }
    }

    //#region TableThaneHistory
    [Serializable]
    public class TableLordHistory : TableServeHistory, ICodeReplace
    {
#region 2013-1-4 19:16:52
public const string VICTORY_RECORD="VictoryRecord";
public const string DEFEAT_RECORD="DefeatRecord";
public const string SUPPORT_COUNT="SupportCount";
public const string OPPOSE_COUNT="OpposeCount";
public const string KEY_HSY_ID="HsyId";
public const string BEGIN_TIME="BeginTime";
public const string END_TIME="EndTime";
public const string PLAYER_ID="PlayerId";
public const string FAC_ID="FacId";

#endregion
public comm.CodeFill FillRegion()
        {
            return new CodeFill(CodeFillType.ORM_CONST, this);
        }

        public int VictoryRecord { get; set; }
        public int DefeatRecord { get; set; }
        public int SupportCount { get; set; }
        public int OpposeCount { get; set; }
    }
    //#endregion

    //#region TableCommanderHistory
    [Serializable]
    public class TableCommanderHistory : TableServeHistory, ICodeReplace
    {
#region 2013-1-4 19:16:52
public const string LORD_PLAYER_ID="LordPlayerId";
public const string TITLE="Title";
public const string KEY_HSY_ID="HsyId";
public const string BEGIN_TIME="BeginTime";
public const string END_TIME="EndTime";
public const string PLAYER_ID="PlayerId";
public const string FAC_ID="FacId";

#endregion
public comm.CodeFill FillRegion()
        {
            return new CodeFill(CodeFillType.ORM_CONST, this);
        }

        private string _lordPlayerId = null;
        public string LordPlayerId
        {
            get
            {
                if (_lordPlayerId == null)
                {
                    _lordPlayerId = "";
                }
                return _lordPlayerId;
            }
            set { _lordPlayerId = value; }
        }

        private string _title = null;
        public string Title
        {
            get
            {
                if (_title == null)
                {
                    _title = "";
                }
                return _title;
            }
            set { _title = value; }
        }
    }
    //#endregion
}
